package com.mhd.databases.config;

import com.mhd.databases.pojo.DbInfo;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author dmh96
 */
@Component
@PropertySource(value = {"classpath:application-prod.properties",
        "file:${spring.profiles.path}/application-prod.properties",}, ignoreResourceNotFound = true)
@ConfigurationProperties(prefix = "dbconfig")
@EnableConfigurationProperties(DbConfig.class)
@Data
public class DbConfig {
    /**
     * oracle数据库连接
     */
    private List<DbInfo> oracle;
    /**
     * mysql数据库连接
     */
    private List<DbInfo> mysql;
}
